package kpi.java_training.view.menu;

import kpi.java_training.domain.User;
import kpi.java_training.service.UserService;
import kpi.java_training.utils.Log;

import java.io.IOException;

/**
 * @author Alexander Palleev
 * @author palleev@ukr.net
 */
public class RegisterItem  implements MenuItem {
    @Override
    public void invoke() {
        UserService userService = new UserService();
        User user = null;

        try {
            user = userService.registerUser();
        } catch (IOException e) {
            Log.writeToLog(e);
        }
        return user;
    }

    @Override
    public String toString() {
        return "Authorization";
    }


    @Override
    public String getActionString() {
        return "Authorization...";
    }
}
